package com.medical.controller;

import com.medical.pojo.TrendVO;
import com.medical.pojo.UsageTrend;
import com.medical.service.UsageTrendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("usageTrend")
public class UsageTrendController {

    @Autowired
    private UsageTrendService usageTrendService;

    @RequestMapping("/findAll")
    private List<UsageTrend> findAll(@RequestBody TrendVO trendVO){
        return usageTrendService.findAll(trendVO);
    }

    @RequestMapping("/findUsageToday")
    public List<String> findUsageToday(@RequestBody TrendVO trendVO){
        return usageTrendService.findUsageToday(trendVO);
    }

    @RequestMapping("/findUsageYesterday")
    public List<String> findUsageYesterday(@RequestBody TrendVO trendVO){
        return usageTrendService.findUsageYesterday(trendVO);
    }

    @RequestMapping("/findJoint")
    public List<String> findJoint(@RequestBody TrendVO trendVO){
        return usageTrendService.findJoint(trendVO);
    }
}
